import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    redirect: '/index',
    path: '/',
  },
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/index.vue'),
    children: [
      {
        redirect: '/index/home',
        path: '/index'
      },
      {
        path: '/index/my',
        name: 'My',
        component: () => import('../views/My/my.vue'),
        children: [
          {
            redirect: '/index/my/a',
            path: '/index/my'
          },
          {
            path: '/index/my/a',
            name: '基础信息',
            component: () => import('../views/My/components/myA.vue'),
          },
          {
            path: '/index/my/b',
            name: '基础信息',
            component: () => import('../views/My/components/myB.vue'),
          },
          {
            path: '/index/my/c',
            name: '基础信息',
            component: () => import('../views/My/components/myC.vue'),
          },
          {
            path: '/index/my/outbound',
            name: '基础信息',
            component: () => import('../views/My/components/outbound.vue')
          },
        ]
      },
      {
        path: '/index/yes',
        name: '基础信息',
        component: () => import('../views/My/components/yes.vue'),
      },
      {
        path: '/index/login',
        name: 'Login',
        component: () => import('../views/Login/login.vue')
      },
      {
        path: '/index/booklist',
        name: 'booklist',
        component: () => import('../views/Booklist/booklist.vue')
      },
      {
        path: '/index/details',
        name: 'details',
        component: () => import('../views/Details/details.vue')
      },
      {
        path: '/index/home',
        name: 'home',
        component: () => import('../views/Home/home.vue')
      },
      {
        path: '/index/order',
        name: 'order',
        component: () => import('../views/Order/order.vue')
      },
      {
        path: '/index/search',
        name: 'search',
        component: () => import('../views/Search/search.vue')
      },
       
    {
      path: '/index/particulars',
      name: 'particulars',
      component: () => import('../views/particulars/particulars.vue')
    },
      {
        path: '/index/shop',
        name: 'shop',
        component: () => import('../views/Shop/index.vue'),
        children:[
          {
            redirect: '/index/shop/affirm',
            path: '/index/shop'
          },
          {
            path: '/index/shop/affirm',
            name: 'affirm',
            component: () => import('../views/Shop/components/affirm.vue'),
          },
          {
            path: '/index/shop/create',
            name: 'create',
            component: () => import('../views/Shop/components/create.vue'),
          },
          {
            path: '/index/shop/fill',
            name: 'fill',
            component: () => import('../views/Shop/components/fill.vue'),
          },
          {
            path: '/index/shop/ok',
            name: 'ok',
            component: () => import('../views/Shop/components/ok.vue'),
          }
        ]
      },


    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
